﻿(function ($) {
    $.mfgjs = {
        getCustomInfoByID: function (ID) {

            $.ajax({
                url: "./MFG.ashx",
                data: {
                    Action: "getCustomInfoByID",
                    ID: ID
                },
                async: true,
                type: "post",
                datatype: "json",
                success: function (data) {
                    Loading(false);
                    data = JSON.parse(data);
                    if (data.length > 0) {
                        $("#title").html(data[0].CustomName + data[0].CustomChejian + "生产信息");
                        $("#chejianimg").attr('src', '../CustomerInfo/uploadFilePath/' + data[0].CustomImg);
                    }
                    else {
                        $("#title").html("");
                        $("#chejianimg").attr('src', '');
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    Loading(false);
                    dialogMsg(errorThrown, -1);
                }
            });
        },

        getEquNoListByID: function (ID) {

            var selectedRowIndex = 0;
            var $gridTable = $('#gridTable');
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "getEquNoListByID",
                    ID: ID
                },
                datatype: "json",
                height: $("#cushawestpanel").height() * 0.5,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '设备类型', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                    { label: '品种', name: 'FangShaKind', index: 'FangShaKind', width: 100, align: 'left' },
                    { label: '当前纺纱长度', name: 'fangshachangdu', index: 'fangshachangdu', width: 100, align: 'left' },
                    { label: '当前效率', name: 'xiaolv', index: 'xiaolv', width: 100, align: 'left' },
                    { label: '车速', name: 'chesu', index: 'chesu', width: 100, align: 'left' },
                    {
                        label: '状态', name: 'state', index: 'state', width: 100, align: 'left',
                        formatter: function (cellvalue, options, rowObject) {
                            if (cellvalue == 1) {
                                return '<span class=\"label label-success\">开车</span>';
                            }
                            else if (cellvalue == 2) {
                                return '<span class=\"label label-warning\">落纱</span>';
                            }
                            else if (cellvalue == 3) {
                                return '<span class=\"label label-danger\">停车</span>';
                            }
                        }
                    },

                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');
                    //var rowData = $gridTable.getRowData(selectedRowIndex);
                    //$("#cushatitle1").html("粗纱实时生产信息--" + rowData["EquNo"]);
                    //$("#cushatitle2").html("停车占比--" + rowData["EquNo"]);
                    //$.mfgjs.shengchancusha(rowData["EquNo"]);
                },
                gridComplete: function () {
                    //$("#" + this.id).setSelection(selectedRowIndex, false);
                    //var rowdata = $gridTable.jqGrid('getRowData', 1);
                    //var EquNo = rowdata["EquNo"];//列名和jGrid定义时候的值一样
                    //$("#cushatitle1").html("粗纱实时生产信息--" + EquNo);
                    //$("#cushatitle2").html("停车占比--" + EquNo);
                    //$.mfgjs.shengchancusha(EquNo);
                }
            });
        },

        getguidaoshengchanByID: function (ID) {

            var selectedRowIndex = 0;
            var $gridTable = $('#guidaoshengchangridTable');
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "getguidaoshengchanByID",
                    ID: ID
                },
                datatype: "json",
                height: $("#guidaoshengchanwestpanel").height() - 100,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '轨道号', name: 'GuiDaoNo', index: 'EquType', width: 100, align: 'left' },
                    { label: '生产品种', name: 'FangShaKind', index: 'FangShaKind', width: 100, align: 'left' },
                    { label: '入库满纱数量', name: 'rukumanshanum', index: 'rukumanshanum', width: 100, align: 'left' },
                    { label: '出库满纱数量', name: 'chukumanshanum', index: 'chukumanshanum', width: 100, align: 'left' },
                    { label: '库存满纱数量', name: 'kucunmanshanum', index: 'kucunmanshanum', width: 100, align: 'left' },
                    { label: '库存空管数量', name: 'kucunkongguannum', index: 'kucunkongguannum', width: 100, align: 'left' },
                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');
                },
                gridComplete: function () {
                }
            });
        },

        initshengchancushajiemian: function () {
            $("#west-Panel").html("");
            $("#cushacenterpanel").html("");
            var html = "";
            html += "<div class='center-Panel'>";
            html += "<div class='panel-Title' id='cushatitle1'>粗纱实时生产信息</div>";
            html += "<table class='form' id='cushashengchan'></table>";
            html += "<div class='panel-Title' style='border-top: 1px solid #ccc;' id='cushatitle2'>停车占比</div>";
            html += "<div id='containerdiv'>";
            html += "<div id='container1' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "</div>";
            html += "<div id='container2' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "</div>";
            html += "</div>";
            html += "</div>";
            $("#cushacenterpanel").append(html);

            var html1 = "";
            html1 += "<div class='panel-Title' id='shengyuwancheng'>当前班次剩余与完成</div>";
            html1 += "<table class='form' id='cushashengchanshengyuwancheng'></table>";
            $("#west-Panel").append(html1);
        },

        initshebeicushajiemian: function () {
            $("#west-Panel").html("");
            $("#cushacenterpanel").html("");
            var html = "";
            html += "<div class='center-Panel'>";
            html += "<div class='panel-Title' id='quxiantitle'>指标曲线图</div>";
            html += "<div id='quxiancontainer'>";
            html += "<div id='containersudu' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "</div>";
            html += "<div id='containerwendu' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "</div>";
            html += "</div>";
            html += "<div class='panel-Title' style='border-top: 1px solid #ccc;' id='tingchetitle'>停车占比原因分析</div>";
            html += "<div id='bingtucontainer'>";
            html += "<div id='bingtu1' style='width: 100%; text-align:center; display: inline-block; float: left;'>";
            html += "</div>";
            //html += "<div id='bingtu2' style='width: 33%; text-align:center; display: inline-block; float: left;'>";
            //html += "</div>";
            //html += "<div id='bingtu3' style='width: 33%; text-align:center; display: inline-block; float: left;'>";
            //html += "</div>";
            html += "</div>";
            html += "</div>";
            $("#cushacenterpanel").append(html);

            var html1 = "";
            html1 += "<div class='panel-Title' id='dangqianfangsha'>当前报警信息</div>";
            html1 += "<table  id='cushashengchandangqianfangsha'></table>";
            $("#west-Panel").append(html1);
        },

        shengchancusha: function (EquNo) {

            $("#cushashengchan").html("");

            $.ajax({
                url: "./MFG.ashx",
                data: {
                    Action: "shengchancusha",
                    EquNo: EquNo
                },
                async: true,
                type: "post",
                datatype: "json",
                success: function (data) {
                    console.log(data);
                    data = JSON.parse(data);
                    if (data.length > 0) {

                        var html = '<tr>';
                        html += '<th class="formTitle">当前长度:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].ChangDu + '</label>';
                        html += '</td>';
                        html += '<th class="formTitle">当前效率:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].XiaoLv + ' </label>';
                        html += '</td>';
                        html += '<th class="formTitle">早班产量:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].ZaobanChanliang + ' </label>';
                        html += '</td>';
                        html += '<th class="formTitle">早班效率:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].ZaobanXiaolv + ' </label>';
                        html += '</td>';
                        html += '</tr>';

                        html += '<th class="formTitle">中班产量:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].ZhongbanChanliang + '</label>';
                        html += '</td>';
                        html += '<th class="formTitle">中班效率:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].ZhongbanXiaolv + ' </label>';
                        html += '</td>';
                        html += '<th class="formTitle">晚班产量:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].WanbanChanliang + ' </label>';
                        html += '</td>';
                        html += '<th class="formTitle">晚班效率:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">' + data[0].WanbanXiaolv + ' </label>';
                        html += '</td>';
                        html += '</tr>';
                        $("#cushashengchan").append(html);

                        $("#cushatitle1").html("粗纱实时生产信息-" + EquNo);
                        $("#cushatitle2").html("停车占比-" + EquNo);
                    }

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    Loading(false);
                    dialogMsg(errorThrown, -1);
                }
            });
        },

        shengchancushashengyu: function (EquNo) {

            $("#cushashengchanshengyuwancheng").html("");

            $.ajax({
                url: "./MFG.ashx",
                data: {
                    Action: "shengchancusha",
                    EquNo: EquNo
                },
                async: true,
                type: "post",
                datatype: "json",
                success: function (data) {
                    console.log(data);
                    data = JSON.parse(data);
                    if (data.length > 0) {

                        var html = '<tr>';
                        html += '<th class="formTitle">剩余时间:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">100</label>';
                        html += '</td>';
                        html += '<th class="formTitle">剩余数量:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">236 </label>';
                        html += '</td>';
                        html += '</tr>';

                        html += '<th class="formTitle">完成时间:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">210</label>';
                        html += '</td>';
                        html += '<th class="formTitle">完成数量:</th>';
                        html += '<td class="formValue">';
                        html += '<label class="valuestyle">413 </label>';
                        html += '</td>';
                        html += '</tr>';
                        $("#cushashengchanshengyuwancheng").append(html);

                        $("#shengyuwancheng").html("当前班次剩余与完成-" + EquNo);

                    }

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    Loading(false);
                    dialogMsg(errorThrown, -1);
                }
            });
        },

        shengchancushadangqianfangsha: function (EquNo) {

            $("#cushashengchandangqianfangsha").html("");
            var selectedRowIndex = 0;
            var $gridTable = $('#cushashengchandangqianfangsha');
            $("#dangqianfangsha").html("当前报警信息-" + EquNo);
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "shengchancushadangqianfangsha",
                    EquNo: EquNo
                },
                datatype: "json",
                height: $("#cushawestpanel").height() * 0.2,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '报警时间', name: 'AlarmTime', index: 'AlarmTime', width: 200, align: 'left' },
                    { label: '报警类型', name: 'AlarmType', index: 'AlarmType', width: 100, align: 'left' },
                    {
                        label: '报警信息', name: 'AlarmInfo', index: 'AlarmInfo', width: 100, align: 'left',
                        formatter: function (cellvalue, options, rowObject) {
                            return '<span class=\"label label-danger\" style="cursor: pointer;" onclick="alarm(event)">' + cellvalue + '</span>';
                        }
                    },
                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');

                },
                gridComplete: function () {

                }
            });
        },

        bancishengchancolumn: function () {

            Highcharts.chart('container1', {
                chart: {
                    type: 'column'
                },
                credits: {
                    enabled: false
                },
                title: {
                    text: '当日班次生产数量'
                },

                xAxis: {
                    type: 'category'
                },
                yAxis: {
                    title: {
                        text: '生产数量'
                    }
                },
                legend: {
                    enabled: false
                },
                plotOptions: {
                    series: {
                        borderWidth: 0,
                        dataLabels: {
                            enabled: true,
                            format: '{point.y:.1f}'
                        }

                    }

                },
                tooltip: {
                    headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
                    pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}</b><br/>'
                },
                series: [{
                    name: '各班次生产数量',
                    colorByPoint: true,
                    data: [{
                        name: '早班',
                        y: 56
                    }, {
                        name: '中班',
                        y: 24
                    }, {
                        name: '晚班',
                        y: 10
                    }]

                }]


            });
        },

        bancishengchanpie: function () {

            var chart = Highcharts.chart('container2', {
                chart: {
                    type: 'pie',
                    options3d: {
                        enabled: true,
                        alpha: 45,
                        beta: 0
                    }
                },
                credits: {
                    enabled: false
                },
                title: {
                    text: '当日班次停车占比',
                    style: {
                        fontSize: '20px'
                    },
                    y: 50
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,  // 可以被选择
                        cursor: 'pointer',       // 鼠标样式
                        depth: 20,
                        dataLabels: {
                            enabled: true,
                            format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            }
                        },
                        showInLegend: true // 设置饼图是否在图例中显示
                    }

                },
                series: [{
                    type: 'pie',
                    name: '班次停车占比',
                    data: [
                            ['早班', 45.0],
                            ['中班', 26.8],
                            {
                                name: '晚班',
                                y: 12.8,
                                sliced: true,  // 默认突出
                                selected: true // 默认选中 
                            }

                    ]
                }]
            });
        },

        tingcheyuanyindangqianpie: function () {
            var chart = Highcharts.chart('bingtu1', {
                chart: {
                    type: 'pie'
                },
                credits: {
                    enabled: false
                },
                title: {
                    text: '当前班次停车原因',
                    style: {
                        fontSize: '20px'
                    },
                    y: 20
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,  // 可以被选择
                        cursor: 'pointer',       // 鼠标样式
                        depth: 20,
                        dataLabels: {
                            enabled: true,
                            format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            }
                        },
                        showInLegend: true // 设置饼图是否在图例中显示
                    }

                },
                series: [{
                    type: 'pie',
                    name: '停车原因占比',
                    data: [
                            ['停车原因1', 25.0],
                            ['停车原因2', 16.8],
                            {
                                name: '停车原因3',
                                y: 32.8,
                                sliced: true,  // 默认突出
                                selected: true // 默认选中 
                            }

                    ]
                }]
            });
        },

        tingcheyuanyinqitafirst: function () {
            var chart = Highcharts.chart('bingtu2', {
                chart: {
                    type: 'pie'
                },
                credits: {
                    enabled: false
                },
                title: {
                    text: '当日其他班次停车原因',
                    style: {
                        fontSize: '20px'
                    },
                    y: 50
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,  // 可以被选择
                        cursor: 'pointer',       // 鼠标样式
                        depth: 20,
                        dataLabels: {
                            enabled: true,
                            format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            }
                        },
                        showInLegend: true // 设置饼图是否在图例中显示
                    }

                },
                series: [{
                    type: 'pie',
                    name: '停车原因占比',
                    data: [
                            ['停车原因1', 35.0],
                            ['停车原因2', 6.8],
                            {
                                name: '停车原因3',
                                y: 42.4,
                                sliced: true,  // 默认突出
                                selected: true // 默认选中 
                            }

                    ]
                }]
            });
        },

        tingcheyuanyinqitasecond: function () {
            var chart = Highcharts.chart('bingtu3', {
                chart: {
                    type: 'pie'
                },
                credits: {
                    enabled: false
                },
                title: {
                    text: '当日其他班次停车原因',
                    style: {
                        fontSize: '20px'
                    },
                    y: 50
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,  // 可以被选择
                        cursor: 'pointer',       // 鼠标样式
                        depth: 20,
                        dataLabels: {
                            enabled: true,
                            format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            }
                        },
                        showInLegend: true // 设置饼图是否在图例中显示
                    }

                },
                series: [{
                    type: 'pie',
                    name: '停车原因占比',
                    data: [
                            ['停车原因1', 24.6],
                            ['停车原因2', 16.8],
                            {
                                name: '停车原因3',
                                y: 34.8,
                                sliced: true,  // 默认突出
                                selected: true // 默认选中 
                            }

                    ]
                }]
            });
        },

        luoshasuduquxian: function () {
            var chart = Highcharts.chart('containersudu', {
                title: {
                    text: '落纱中各速度'
                },
                credits: {
                    enabled: false
                },
                xAxis: [{
                    categories: ['1层', '2层', '3层', '4层', '5层', '6层', '7层', '8层']
                }],
                yAxis: {
                    title: {
                        text: '转速'
                    }
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'middle'
                },
                plotOptions: {
                    series: {
                        label: {
                            connectorAllowed: false
                        }
                    }
                },
                series: [{
                    name: '锭翼电机速度',
                    data: [4393, 5250, 5717, 6965, 9703, 1199, 1371, 1541]
                }, {
                    name: '筒管电机速度',
                    data: [2491, 2404, 2974, 2985, 3249, 3028, 3812, 4043]
                }, {
                    name: '升降电机速度',
                    data: [1174, 1772, 1605, 1971, 2085, 2477, 3147, 3387]
                }, {
                    name: '罗拉电机速度',
                    data: [null, null, 7988, 1269, 1512, 2452, 3400, 3227]
                }],
                responsive: {
                    rules: [{
                        condition: {
                            maxWidth: 500
                        },
                        chartOptions: {
                            legend: {
                                layout: 'horizontal',
                                align: 'center',
                                verticalAlign: 'bottom'
                            }
                        }
                    }]
                }
            });
        },

        lushawenduquxian: function () {
            var chart = Highcharts.chart('containerwendu', {
                title: {
                    text: '落纱温度'
                },
                credits: {
                    enabled: false
                },
                xAxis: [{
                    categories: ['1层', '2层', '3层', '4层', '5层', '6层', '7层', '8层']
                }],
                yAxis: {
                    title: {
                        text: '温度'
                    },
                    labels: {
                        format: '{value} °C'
                    },
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'middle'
                },
                plotOptions: {
                    series: {
                        label: {
                            connectorAllowed: false
                        }
                    }
                },
                series: [{
                    name: '锭翼电机温度',
                    data: [56, 43, 57, 69, 97, 11, 13, 15]
                }, {
                    name: '筒管电机温度',
                    data: [24, 24, 29, 29, 32, 30, 38, 40]
                }, {
                    name: '升降电机温度',
                    data: [11, 17, 16, 19, 20, 24, 31, 33]
                }, {
                    name: '罗拉电机温度度',
                    data: [63, 75, 79, 12, 15, 24, 34, 32]
                }],
                responsive: {
                    rules: [{
                        condition: {
                            maxWidth: 500
                        },
                        chartOptions: {
                            legend: {
                                layout: 'horizontal',
                                align: 'center',
                                verticalAlign: 'bottom'
                            }
                        }
                    }]
                }
            });
        },

        initcushazhuangtaijiemian: function () {
            $("#west-Panel").html("");
            $("#cushacenterpanel").html("");
            var html = "";
            html += "<div class='center-Panel'>";
            html += "<div class='panel-Title' id='quxiantitle'>粗纱主机状态列表</div>";
            html += "<div id='zhujizhangtai' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "<h3>主机状态列表</h3>"
            html += "<div style='border:1px solid #ccc;'>"
            html += "<table id='zhuangtai-1'></table>"
            html += "</div>";
            html += "</div>";
            html += "<div id='luoshazhuangtai' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "<h3>落纱状态列表</h3>"
            html += "<div style='border:1px solid #ccc;'>"
            html += "<table id='zhuangtai-2'></table>"
            html += "</div>";
            html += "</div>";
            html += "<div id='zhujiguzhang' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "<h3>主机故障列表</h3>"
            html += "<div style='border:1px solid #ccc;'>"
            html += "<table id='zhuangtai-3'></table>"
            html += "</div>";
            html += "</div>";
            html += "<div id='lushaguzhang' style='width: 50%; text-align:center; display: inline-block; float: left;'>";
            html += "<h3>落纱故障列表</h3>"
            html += "<div style='border:1px solid #ccc;'>"
            html += "<table id='zhuangtai-4'></table>"
            html += "</div>";
            html += "</div>";
            html += "</div>";
            $("#cushacenterpanel").append(html);
        },

        zhujizhangtailiebiao: function (EquNo) {

            var selectedRowIndex = 0;
            var $gridTable = $('#zhuangtai-1');
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "zhujizhangtailiebiao",
                    EquNo: EquNo
                },
                datatype: "json",
                height: $("#zhujizhangtai").height() - 100,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '状态', name: 'state', index: 'state', width: 100, align: 'left' },
                    { label: '频次', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                    { label: '时间', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');
                },
                gridComplete: function () {

                }
            });
        },

        luoshazhaungtailiebiao: function (EquNo) {

            var selectedRowIndex = 0;
            var $gridTable = $('#zhuangtai-2');
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "zhujizhangtailiebiao",
                    EquNo: EquNo
                },
                datatype: "json",
                height: $("#zhujizhangtai").height() - 100,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '状态', name: 'state', index: 'state', width: 100, align: 'left' },
                    { label: '频次', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                    { label: '时间', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');
                },
                gridComplete: function () {

                }
            });
        },

        zhujiguzhangliebiao: function (EquNo) {

            var selectedRowIndex = 0;
            var $gridTable = $('#zhuangtai-3');
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "zhujizhangtailiebiao",
                    EquNo: EquNo
                },
                datatype: "json",
                height: $("#zhujizhangtai").height() - 100,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '故障', name: 'state', index: 'state', width: 200, align: 'left' },
                    { label: '频次', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                    { label: '时间', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');
                },
                gridComplete: function () {

                }
            });
        },

        luoshaguzhangliebiao: function (EquNo) {

            var selectedRowIndex = 0;
            var $gridTable = $('#zhuangtai-4');
            $gridTable.jqGrid({
                url: "./MFG.ashx",
                postData: {
                    Action: "zhujizhangtailiebiao",
                    EquNo: EquNo
                },
                datatype: "json",
                height: $("#zhujizhangtai").height() - 100,
                autowidth: true,
                colModel: [
                    { label: '粗纱台号', name: 'EquNo', index: 'EquNo', width: 100, align: 'left' },
                    { label: '故障', name: 'state', index: 'state', width: 200, align: 'left' },
                    { label: '频次', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                    { label: '时间', name: 'EquType', index: 'EquType', width: 100, align: 'left' },
                ],
                viewrecords: true,
                rowNum: 10000,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                onSelectRow: function () {
                    selectedRowIndex = $("#" + this.id).getGridParam('selrow');
                },
                gridComplete: function () {

                }
            });
        },

        initguidaoshengchanjiemian: function () {

            $("#guidaoshengchancenterpanel").html("");
            var html = "";
            html += "<div class='center-Panel'>";

            html += "<div class='panel-Title'>满纱与入库占比</div>";
            html += "<div id='mansharuku' style='width: 100%; margin-top:100px; text-align:center; display: inline-block; float: left;'>";
            html += "</div>";
            html += "</div>";
            $("#guidaoshengchancenterpanel").append(html);
        },

        mansharukubingtu: function () {
            var chart = Highcharts.chart('mansharuku', {
                chart: {
                    type: 'pie',
                    options3d: {
                        enabled: true,
                        alpha: 45,
                        beta: 0
                    }
                },
                credits: {
                    enabled: false
                },
                title: {
                    text: '出库满纱数量与入库数量占比',
                    style: {
                        fontSize: '20px'
                    },
                    y: 50
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,  // 可以被选择
                        cursor: 'pointer',       // 鼠标样式
                        depth: 20,
                        dataLabels: {
                            enabled: true,
                            format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            }
                        },
                        showInLegend: true // 设置饼图是否在图例中显示
                    }

                },
                series: [{
                    type: 'pie',
                    name: '数量占比',
                    data: [
                            ['出库满纱数量', 88.0],
                            ['入库数量', 100.0]

                    ]
                }]
            });
        }
    };


    $(function () {

    });
})(jQuery);